-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile ES2015 modules with ES5 target #889
Conversation
Tree shaking is kind of broken in webpack atm I think. How about rollup? |
Indeed, I would suggest testing the shaking via rollup - that's where you'll see the big difference between wrapped commonjs VS tree-shaken modules. As best I understand it, the underlying issue is that webpack cannot dissolve module boundaries (because it needs to do crazy stuff like HMR) whereas rollup prioritizes that (and thus would likely never be able to support HMR). |
So, does merging this provide any real value to anyone? |
@mweststrate main win prior to webpack's tree shaking being pushed a little further would simply be that you don't end up with 2 UMD wrappers (mobx's and webpack's). It also enables rollup to work without the commonjs plugin and produces much smaller bundles therein. |
@mohsen1 did you verify that everything still works as expected in both webpack 1 and 2? |
Not in webpack 1 and rollup. My example repo is easily modifiable for testing webpack 1 |
@mohsen1 could you do a quick test whether webpack 1 still works? In that case this could be merged :) |
I think it works. With this setup I got following output:
|
I think this one can be closed in favor of #1027 ? (the advantage of rollup is that it actually solved the fundamentally ugly single-build script) |
Closing, since #1027 has been merged |
Trying again!
This time we're compiling to ES5 but with ES2015 modules.
I setup a repo to demonstrate how tree-shaking with Webpack 2.0 works. But.... it doesn't!
Repo: https://github.com/mohsen1/mobx-es2015
@TheLarkInn what are we doing wrong?